Repository navigation
Conversation
Coverage Report for CI Build 42224635644Coverage decreased (-0.006%) to 93.631%Details
Uncovered ChangesNo uncovered changes found. Coverage RegressionsNo coverage regressions found. Coverage Stats💛 - Coveralls |
Neither had a value converter, so a parameter declared with one was sent
as ToString() in the current culture: "1234,5" under fr-FR, stored as such
in a VARCHAR column and refused by a DOUBLE one. A decimal value now infers
DbType.Decimal, as the ADO.NET inference table and GetSchema("DataTypes")
say, instead of DbType.Currency.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The new converters fell back to DuckDBCreateVarchar(string), which stops at a NUL character. Route the fallback through CreateVarchar, as the other string values are, and test a text value with a NUL character. Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
alaricd
force-pushed
the
fix/decimal-dbtype
branch
from
November 6, 2026 13:19
56707fe to
ce3dc01
Compare
This branch is waiting to be deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
DbType.DecimalandDbType.DateTime2have no entry inClrToDuckDBConverter.ValueCreators. A parameter declared with either type falls through toNativeMethods.Value.DuckDBCreateVarchar(item.ToString()), so the value is sent as text in the current culture. Underfr-FRorde-DE, a declared decimal is sent as1234,5:de-DE)DbType.Decimal,Value = 1234.5mINSERTinto aVARCHARcolumn1234,5INSERTinto aDOUBLEcolumnConversion Error: Could not convert string '1234,5' to DOUBLESELECT ?1234,5, not adecimalA
DECIMALcolumn is not affected, because the target type routes the value through(DuckDBType.Decimal, decimal value)first.Today this mostly stays hidden because a decimal value infers
DbType.Currency, which does have a converter. Once #369 lets an explicitDbTypesurvive assigningValue, every caller that setsDbType.Decimalhits this path.Changes
DbType.Decimalgets a converter: adecimalis sent as a DECIMAL, exactly likeDbType.Currency. Any other value keeps the previous fallback, soDbType.Decimalwith anintstill works. A text value is sent whole, NUL characters included, through the sameCreateVarcharpath as other strings.DbType.DateTime2is sent likeDbType.DateTime(a TIMESTAMP). Any other value keeps the previous fallback, through the sameCreateVarcharpath.decimalvalue now infersDbType.Decimalinstead ofDbType.Currency. This matches the ADO.NET inference table and DuckDB.NET's ownGetSchema("DataTypes")(Support ADO.NET schema data types and metadata probing #364), which mapsDECIMALtoSystem.Decimal. Binding does not change: both types send the same DECIMAL value, andDbType.Currencykeeps working when set explicitly.Tests
DecimalValueInfersDbTypeDecimalExplicitDecimalDbTypeIsSentAsADecimalInAnyCulture(DecimalandCurrency, underfr-FR:SELECT ?, aVARCHARcolumn and aDOUBLEcolumn)ExplicitDecimalDbTypeWithAnIntegerValueIsStillSentExplicitDecimalDbTypeWithATextValueKeepsItsNulCharacters(fails with the fallback going straight toDuckDBCreateVarchar:lengthis 1, not 3)ExplicitDateTime2DbTypeIsSentAsATimestampInAnyCulture(de-DE)ExplicitDateTime2DbTypeWithATextValueIsStillSentThe six tests above pass in each of five repeated runs on the rebased branch.
Rebase and verification (this update)
developat881ef26(97 commits ahead of the previous base). One conflict inClrToDuckDBConverter.cs, withCreateVarcharfrom upstream kept andTimestampToDuckDBValueadded beside it.ce3dc01routes the new fallbacks throughCreateVarchar(which upstream added for NUL-safe strings) and adds the NUL test.DuckDB.NET.DataandDuckDB.NET.Testbuild with 0 warnings on net8.0 (/p:BuildType=Full, Release).DuckDB.NET.Testsuite, net8.0, including the connection stress tests: 3942 passed, 1 skipped in the runs that completed clean. In 3 of 7 full runs on this branch, one other test failed:DuckDBDataReaderMemoryTests.NextResultReleasesPreviousResult. It asserts that process memory growth stays under 100 MB over 20 runs. It fails in isolation on this branch (4 of 5 runs) and also fails on a cleandevelopcheckout at881ef26(5 of 5 runs, growth 118 MB), so it is a pre-existing failure and not caused by this change. It is not fixed here.Releasepackage build with native libraries for all platforms, andnet10.0test execution (the test project targets net8.0 only).🤖 Generated with Claude Code